home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / CursorDevices.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  4.9 KB  |  219 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CursorDevices.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__CURSORDEVICES__') = 'UNDEFINED' THEN
  18. __CURSORDEVICES__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  27.     include 'MixedMode.a'
  28.     ENDIF
  29. ; ButtonOpcodes 
  30.  
  31. kButtonNoOp                        EQU        0                    ; No action for this button 
  32. kButtonSingleClick                EQU        1                    ; Normal mouse button 
  33. kButtonDoubleClick                EQU        2                    ; Click-release-click when pressed 
  34. kButtonClickLock                EQU        3                    ; Click on press, release on next press 
  35. kButtonCustom                    EQU        6                    ; Custom behavior, data = CursorDeviceCustomButtonUPP 
  36.  
  37. ; Device Classes 
  38. kDeviceClassAbsolute            EQU        0                    ; a flat-response device 
  39. kDeviceClassMouse                EQU        1                    ; mechanical or optical mouse 
  40. kDeviceClassTrackball            EQU        2                    ; trackball 
  41. kDeviceClass3D                    EQU        6                    ; a 3D pointing device 
  42.  
  43. ; Structures used in Cursor Device Manager calls 
  44. CursorData                 RECORD    0
  45. nextCursorData             ds.l    1                                    ; next in global list 
  46. displayInfo                 ds.l    1                                    ; unused (reserved for future) 
  47. whereX                     ds.l    1                                    ; horizontal position 
  48. whereY                     ds.l    1                                    ; vertical position 
  49. where                     ds        Point                                ; the pixel position 
  50. isAbs                     ds.b    1                                    ; has been stuffed with absolute coords 
  51. buttonCount                 ds.b    1                                    ; number of buttons currently pressed 
  52. screenRes                 ds.w    1                                    ; pixels per inch on the current display 
  53. privateFields             ds.w    22                                ; fields use internally by CDM 
  54. sizeof                     EQU    68
  55.                         ENDR
  56.  
  57. CursorDevice             RECORD    0
  58. nextCursorDevice         ds.l    1                                    ; pointer to next record in linked list 
  59. whichCursor                 ds.l    1                                    ; pointer to data for target cursor 
  60. refCon                     ds.l    1                                    ; application-defined 
  61. unused                     ds.l    1                                    ; reserved for future 
  62. devID                     ds.l    1                                    ; device identifier (from ADB reg 1) 
  63. resolution                 ds.l    1                                    ; units/inch (orig. from ADB reg 1) 
  64. devClass                 ds.b    1                                    ; device class (from ADB reg 1) 
  65. cntButtons                 ds.b    1                                    ; number of buttons (from ADB reg 1) 
  66. filler1                     ds.b    1                                    ; reserved for future 
  67. buttons                     ds.b    1                                    ; state of all buttons 
  68. buttonOp                 ds.b    8                                    ; action performed per button 
  69. buttonTicks                 ds.l    8                                    ; ticks when button last went up (for debounce) 
  70. buttonData                 ds.l    8                                    ; data for the button operation 
  71. doubleClickTime             ds.l    1                                    ; device-specific double click speed 
  72. acceleration             ds.l    1                                    ; current acceleration 
  73. privateFields             ds.w    15                                ; fields used internally to CDM 
  74. sizeof                     EQU    138
  75.                         ENDR
  76.  
  77. ; for use with CursorDeviceButtonOp when opcode = kButtonCustom 
  78.     IF GENERATING68K THEN
  79.         Macro
  80.         _CursorDeviceMove
  81.             moveq    #0,d0
  82.             dc.w     $AADB
  83.         EndM
  84.     ELSE
  85.         IMPORT    CursorDeviceMove
  86.     ENDIF
  87.  
  88.     IF GENERATING68K THEN
  89.         Macro
  90.         _CursorDeviceMoveTo
  91.             moveq    #1,d0
  92.             dc.w     $AADB
  93.         EndM
  94.     ELSE
  95.         IMPORT    CursorDeviceMoveTo
  96.     ENDIF
  97.  
  98.     IF GENERATING68K THEN
  99.         Macro
  100.         _CursorDeviceFlush
  101.             moveq    #2,d0
  102.             dc.w     $AADB
  103.         EndM
  104.     ELSE
  105.         IMPORT    CursorDeviceFlush
  106.     ENDIF
  107.  
  108.     IF GENERATING68K THEN
  109.         Macro
  110.         _CursorDeviceButtons
  111.             moveq    #3,d0
  112.             dc.w     $AADB
  113.         EndM
  114.     ELSE
  115.         IMPORT    CursorDeviceButtons
  116.     ENDIF
  117.  
  118.     IF GENERATING68K THEN
  119.         Macro
  120.         _CursorDeviceButtonDown
  121.             moveq    #4,d0
  122.             dc.w     $AADB
  123.         EndM
  124.     ELSE
  125.         IMPORT    CursorDeviceButtonDown
  126.     ENDIF
  127.  
  128.     IF GENERATING68K THEN
  129.         Macro
  130.         _CursorDeviceButtonUp
  131.             moveq    #5,d0
  132.             dc.w     $AADB
  133.         EndM
  134.     ELSE
  135.         IMPORT    CursorDeviceButtonUp
  136.     ENDIF
  137.  
  138.     IF GENERATING68K THEN
  139.         Macro
  140.         _CursorDeviceButtonOp
  141.             moveq    #6,d0
  142.             dc.w     $AADB
  143.         EndM
  144.     ELSE
  145.         IMPORT    CursorDeviceButtonOp
  146.     ENDIF
  147.  
  148.     IF GENERATING68K THEN
  149.         Macro
  150.         _CursorDeviceSetButtons
  151.             moveq    #7,d0
  152.             dc.w     $AADB
  153.         EndM
  154.     ELSE
  155.         IMPORT    CursorDeviceSetButtons
  156.     ENDIF
  157.  
  158.     IF GENERATING68K THEN
  159.         Macro
  160.         _CursorDeviceSetAcceleration
  161.             moveq    #8,d0
  162.             dc.w     $AADB
  163.         EndM
  164.     ELSE
  165.         IMPORT    CursorDeviceSetAcceleration
  166.     ENDIF
  167.  
  168.     IF GENERATING68K THEN
  169.         Macro
  170.         _CursorDeviceDoubleTime
  171.             moveq    #9,d0
  172.             dc.w     $AADB
  173.         EndM
  174.     ELSE
  175.         IMPORT    CursorDeviceDoubleTime
  176.     ENDIF
  177.  
  178.     IF GENERATING68K THEN
  179.         Macro
  180.         _CursorDeviceUnitsPerInch
  181.             moveq    #10,d0
  182.             dc.w     $AADB
  183.         EndM
  184.     ELSE
  185.         IMPORT    CursorDeviceUnitsPerInch
  186.     ENDIF
  187.  
  188.     IF GENERATING68K THEN
  189.         Macro
  190.         _CursorDeviceNextDevice
  191.             moveq    #11,d0
  192.             dc.w     $AADB
  193.         EndM
  194.     ELSE
  195.         IMPORT    CursorDeviceNextDevice
  196.     ENDIF
  197.  
  198.     IF GENERATING68K THEN
  199.         Macro
  200.         _CursorDeviceNewDevice
  201.             moveq    #12,d0
  202.             dc.w     $AADB
  203.         EndM
  204.     ELSE
  205.         IMPORT    CursorDeviceNewDevice
  206.     ENDIF
  207.  
  208.     IF GENERATING68K THEN
  209.         Macro
  210.         _CursorDeviceDisposeDevice
  211.             moveq    #13,d0
  212.             dc.w     $AADB
  213.         EndM
  214.     ELSE
  215.         IMPORT    CursorDeviceDisposeDevice
  216.     ENDIF
  217.  
  218.     ENDIF ; __CURSORDEVICES__
  219.